<?php
header("Content-type: text/html; charset=utf-8");
include 'configs\config.php';
$url = 'http://'.$_SERVER['HTTP_HOST'].substr($_SERVER["PHP_SELF"],0,strrpos($_SERVER["PHP_SELF"],"/")+1);
$mysql = new mysql();
$mysql->open($config);
$softid = @trim($_GET['softid']);
if(intval($softid)==0){$softid=1;}
$where = 'softid='.$softid;
$query = $mysql->select('*', 'softapp',$where);
$res   = array();
foreach($query as $value){
	$arr["id"]      = $value['id'];
	$arr["appname"] = $value['appname'];
	$arr["appinfo"] = $value['appinfo']; 
	$arr["appurl"]  = $url.'upload/apk/'.$value['appurl']; 
	$arr["appicon"] = $url.'upload/img/'.$value['appicon']; 		
	$res[]=$arr;	
}
unset($mysql);
echo json_encode($res);
?>